import React from "react"
import {withRouter} from 'react-router-dom'
// assets
import NormalIcon from '../../../../res/images/web/my/vip／1@2x.png'
import VipIcon from '../../../../res/images/web/my/vip／2@2x.png'

// antd-mobile
import {List} from "antd-mobile"
const Item = List.Item

const MyVIP = (props) => {

    const {userDetail: {Viplevel, Vip},} = props
    const isVip = Vip > 0

    const vipStyle = {
        width: '68px',
        height: '45px',
    }

    const vipThumb = (
        <img src={isVip ? VipIcon : NormalIcon} alt='vip' style={vipStyle}/>
    )
    return (
        <List>
            <Item
                thumb={vipThumb}
                extra="了解会员权益"
                arrow="horizontal"
                style={{
                    height: '60px',
                    borderRadius: '8px',
                    backgroundColor: '#fff'
                }}
                onClick={() => props.history.push('../vip-goods')}
            >{isVip ? '尊享会员' : '普通会员'}</Item>
        </List>
    )
}

export default withRouter(MyVIP)
